﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PRE
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {

        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            
                string a = "", b = "", c = "";
                Hienngay(ref a, ref b, ref c);
                sticthu.Text = a;
                sticNgay.Text = b;
                sticGio.Text = c;

            
          
        }
        public void Hienngay(ref string Ngaythangnam, ref string Gio, ref string timeofday)
        {
            try
            {
                string[] a = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
                string[] b = { "Chủ nhật", "Thứ 2", "Thứ 3", "Thứ 4", "Thứ 5", "Thứ 6", "Thứ 7" };
                string[] c = { "AM", "PM" };
                //string[] d = { "Sáng", "Chiều" };
                string thu = "";
                string tgngay = "";
                string ngay = DateTime.Now.Day.ToString();
                string thang = DateTime.Now.Month.ToString();
                string nam = DateTime.Now.Year.ToString();
                string thoigian = DateTime.Now.ToString().Substring(9, 9);
                //
                for (int i = 0; i < c.Length; i++)
                {
                    if (DateTime.Now.ToString().Substring(DateTime.Now.ToString().Length - 2, 2).ToLower().Trim() == c[i].ToLower().Trim())
                    { tgngay = c[i]; }
                }
                for (int i = 0; i < a.Length; i++)
                {
                    if (DateTime.Now.DayOfWeek.ToString().ToLower().Trim() == a[i].ToLower().Trim())
                    { thu = b[i]; }

                }
                Ngaythangnam = thu + ", " + ngay + "/" + thang + "/" + nam;
                Gio = thoigian;
                timeofday = tgngay;
            }
            catch
            {
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void mnuDangnhap_Click(object sender, EventArgs e)
        {
            frmDangnhap frmDN = new frmDangnhap();
            frmDN.Show();
        }

        private void tmnuTaikhoan_Click(object sender, EventArgs e)
        {
            frmTaikhoan frmTK = new frmTaikhoan();
            frmTK.Show();
        }

        private void mnuDangxuat_Click(object sender, EventArgs e)
        {
            
        }

        private void mnuChucvu_Click(object sender, EventArgs e)
        {
            frmChucvu frmCV = new frmChucvu();
            frmCV.Show();
        }

        private void mnuSanpham_Click(object sender, EventArgs e)
        {
            frmSanpham frmSP = new frmSanpham();
            frmSP.Show();
        }

        private void mnuLoaiSP_Click(object sender, EventArgs e)
        {
            frmLoaiSP frmLSP = new frmLoaiSP();
            frmLSP.Show();
        }

        private void mnuChatlieu_Click(object sender, EventArgs e)
        {
            frmChatlieu frmCL = new frmChatlieu();
            frmCL.Show();
        }

        private void mnuNhanvien_Click(object sender, EventArgs e)
        {
            frmNhanvien frmNV = new frmNhanvien();
            frmNV.Show();
        }

        private void mnuNCC_Click(object sender, EventArgs e)
        {
            frmNCC frmCC = new frmNCC();
            frmCC.Show();
        }

        private void mnuKh_Click(object sender, EventArgs e)
        {
            frmKhachhang frmKH = new frmKhachhang();
            frmKH.Show();
        }

        

       

       

        

      

        
    }
}
